package com.aiit.dao;

import com.aiit.pojo.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface ICustomerDao extends BaseMapper<Customer> {
    @Select("select count(*) from t_customer_address where customer_id=#{cId} and address=#{address} and deleted=1")
    Integer queryAddressByCid(@Param("cId") Integer cId, @Param("address") String address);
    @Insert("insert into t_customer_address(customer_id,address) values(#{id},#{address})")
    Integer insert2(@Param("id") Integer id, @Param("address") String address);
    @Select("select count(*) from t_customer where name=#{name} and deleted=1")
    Integer querByName(String name);
}
